Solution:
code1 = 'FVNISJND-XX-2020' code2 = 'FVNISJND-XY-2019' print(f"code1: {code1.endswith('2020')}") print(f"code2: {code2.endswith('2020')}")